<!-- BEGIN SIDEBAR -->
<div class="sidebar col-md-3 col-sm-5">
    <ul class="list-group margin-bottom-25 sidebar-menu">

        <?php
            foreach ($this->allcates as $item) {
                // 取出子节点
                $children = $item['children'];
                if (count($children)) {
        ?>
        <li class="list-group-item clearfix dropdown">
            <a href="javascript:void(0);" class="collapsed"><i class="fa fa-angle-right"></i><?php echo $item['name']; ?></a>
            <ul class="dropdown-menu" style="display:block;">
        <?php
                    for ($i=0; $i<count($children); $i++) {
        ?>
                <li><a href="/childproductgroup/detail/<?php echo $children[$i]['id']; ?>"><i class="fa fa-angle-right"></i> <?php echo $children[$i]['name']; ?></a></li>
        <?php
                    }
        ?>
            </ul>
        </li>
        <?php
                } else {
        ?>
        <li class="list-group-item clearfix"><a href="/brandgroup/detail/<?php echo $item['id']; ?>"><i class="fa fa-angle-right"></i> <?php echo $item['name']; ?></a></li>
        <?php
                }
            }
        ?>

    </ul>
</div>
<!-- END SIDEBAR -->
